resource "huaweicloud_dcs_instance" "mod_redis" {
  name               = var.redis_name
  engine             = "Redis"
  engine_version     = var.redis_version
  capacity           = var.capacity
  flavor             = var.redis_flavor
  availability_zones = var.availability_zones
  password           = var.password
  vpc_id             = var.vpc_id
  subnet_id          = var.subnet_id

  charging_mode = "postPaid"
  /* period_unit   = "month"
  auto_renew    = "true"
  period        = "1" */

  backup_policy {
    backup_type = "auto"
    save_days   = 7
    backup_at   = [1, 3, 5, 7]
    begin_at    = "02:00-04:00"
  }

  whitelists {
    group_name = "baiduhub-vpc-group-dev"
    ip_address = var.whitelists_ip
  }
}